home *** CD-ROM | disk | FTP | other *** search
- Path: news.uh.edu!usenet
- From: Sensarn <txs53132@bayou.uh.edu>
- Newsgroups: comp.lang.c++
- Subject: Re: how to pass matrix to function turbo c++?
- Date: 25 Jan 1996 22:54:08 GMT
- Organization: AEtna Insurance Agency
- Message-ID: <4e91mg$iup@masala.cc.uh.edu>
- References: <4e7ftm$11n@newsbf02.news.aol.com>
- NNTP-Posting-Host: sip-14125.public-dialups.uh.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1 (Windows; U; 16bit)
-
- I'm not sure if I understand what you want, but I think you want to send
- a copy of the array to the function. Use a pointer:
-
- //This is just an example
- void multiply(int *number,float factor);
-
- void main(void)
- {
- int number=10; //Number is equal to 10 now
- multiply(&number,2) //Send address of variable to function
- while(number==10); //This loop will not do anything because number
- //equals 20
- }
-
- void multiply(int *number,float factor)
- {
- *number*=factor;
- }
-
- Steven Sensarn - txs53132@bayou.uh.edu
-
-